package com.m4f.cityclient.api.service.impl;

import java.util.logging.Logger;

import com.m4f.cityclient.api.exception.M4FCityClientException;
import com.m4f.cityclient.api.models.UserCity;
import com.m4f.cityclient.api.service.ifc.M4FUserApiService;
import com.m4f.cityclient.common.model.M4FOAuthUser;
import com.m4f.cityclient.common.service.ifc.M4FOAuthUserService;


/**
 * @author David Basoko
 */
public class M4FUserApiServiceImpl extends M4FBaseApiService implements M4FUserApiService {
	private static final Logger LOGGER = Logger.getLogger(M4FUserApiServiceImpl.class.getName());
	
	private String m4fscUserInfoUrl;
	private M4FOAuthUserService userService;
	
	@Override
	public M4FOAuthUser getUserInfo() throws M4FCityClientException {
		UserCity userCity = this.getData(getM4fscUserInfoUrl(), UserCity.class);
		return userService.createUser(userCity);	
	}

	public String getM4fscUserInfoUrl() {
		return m4fscUserInfoUrl;
	}

	public void setM4fscUserInfoUrl(String m4fscUserInfoUrl) {
		this.m4fscUserInfoUrl = m4fscUserInfoUrl;
	}

	public void setUserService(M4FOAuthUserService userService) {
		this.userService = userService;
	}
}
